﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Toolbelt.ComponentModel.DataAnnotations.Schema;

namespace HCD.Entities
{
    [Table("HIS_ORDERS")]
    public class HisOrders : Entity<long>
    {
        /// <summary>
        /// 病人标识号
        /// </summary>
        [Column("PATIENT_ID", TypeName = "VARCHAR(60)"), Required, Index("INDEX_HIS_ORDERS", 1, IsUnique = true)]
        public string PatientId { get; set; }

        /// <summary>
        /// 病人本次住院标识
        /// </summary>
        [Column("VISIT_ID", TypeName = "VARCHAR(60)"), Required, Index("INDEX_HIS_ORDERS", 2, IsUnique = true)]
        public string VisitId { get; set; }

        /// <summary>
        /// 医嘱序号
        /// </summary>
        [Column("ORDER_NO", TypeName = "INT"), Index("INDEX_HIS_ORDERS", 3, IsUnique = true)]
        public int OrderNo { get; set; }

        /// <summary>
        /// 医嘱子序号
        /// </summary>
        [Column("ORDER_SUB_NO", TypeName = "INT"), Index("INDEX_HIS_ORDERS", 4, IsUnique = true)]
        public int OrderSubNo { get; set; }

        /// <summary>
        /// 长期医嘱标志 0临时  1长期
        /// </summary>
        [Column("REPEAT_INDICATOR", TypeName = "INT")]
        public int RepeatIndicator { get; set; }

        /// <summary>
        /// 医嘱类别
        /// </summary>
        [Column("ORDER_CLASS", TypeName = "VARCHAR(1)"), Required]
        public string OrderClass { get; set; }

        /// <summary>
        /// 医嘱正文
        /// </summary>
        [Column("ORDER_TEXT", TypeName = "VARCHAR(800)"), Required]
        public string OrderText { get; set; }

        /// <summary>
        /// 医嘱代码
        /// </summary>
        [Column("ORDER_CODE", TypeName = "VARCHAR(200)"), Required]
        public string OrderCode { get; set; }

        /// <summary>
        /// 药品一次使用剂量
        /// </summary>
        [Column("DOSAGE", TypeName = "DECIMAL")]
        public decimal Dosage { get; set; }

        /// <summary>
        /// 剂量单位
        /// </summary>
        [Column("DOSAGE_UNITS", TypeName = "VARCHAR(8)")]
        public string DosageUnits { get; set; }

        /// <summary>
        /// 给药途径和方法
        /// </summary>
        [Column("ADMINISTRATION", TypeName = "VARCHAR(16)")]
        public string Administration { get; set; }

        /// <summary>
        /// 持续时间
        /// </summary>
        [Column("DURATION", TypeName = "DECIMAL")]
        public decimal? Duration { get; set; }

        /// <summary>
        /// 持续时间单位
        /// </summary>
        [Column("DURATION_UNITS", TypeName = "VARCHAR(4)")]
        public string DurationUnits { get; set; }

        /// <summary>
        /// 起始日期及时间
        /// </summary>
        [Column("START_DATE_TIME", TypeName = "DATETIME")]
        public DateTime StartDateTime { get; set; }

        /// <summary>
        /// 停止日期及时间
        /// </summary>
        [Column("STOP_DATE_TIME", TypeName = "DATETIME")]
        public DateTime? StopDateTime { get; set; }

        /// <summary>
        /// 执行频率描述
        /// </summary>
        [Column("FREQUENCY", TypeName = "VARCHAR(16)")]
        public string Frequency { get; set; }

        /// <summary>
        /// 频率次数
        /// </summary>
        [Column("FREQ_COUNTER", TypeName = "INT")]
        public int? FreqCounter { get; set; }

        /// <summary>
        /// 频率间隔
        /// </summary>
        [Column("FREQ_INTERVAL", TypeName = "INT")]
        public int? FreqInterval { get; set; }

        /// <summary>
        /// 频率间隔单位
        /// </summary>
        [Column("FREQ_INTERVAL_UNIT", TypeName = "VARCHAR(4)")]
        public string FreqIntervalUnit { get; set; }

        /// <summary>
        /// 医生说明
        /// </summary>
        [Column("FREQ_DETAIL", TypeName = "VARCHAR(1000)")]
        public string FreqDetail { get; set; }

        /// <summary>
        /// 护士执行时间
        /// </summary>
        [Column("PERFORM_SCHEDULE", TypeName = "VARCHAR(64)")]
        public string PerformSchedule { get; set; }

        /// <summary>
        /// 执行结果
        /// </summary>
        [Column("PERFORM_RESULT", TypeName = "VARCHAR(8)")]
        public string PerformResult { get; set; }

        /// <summary>
        /// 开医嘱科室
        /// </summary>
        [Column("ORDERING_DEPT", TypeName = "VARCHAR(20)")]
        public string OrderingDept { get; set; }

        /// <summary>
        /// 开医嘱医生
        /// </summary>
        [Column("DOCTOR", TypeName = "VARCHAR(20)")]
        public string Doctor { get; set; }

        /// <summary>
        /// 停医嘱医生
        /// </summary>
        [Column("STOP_DOCTOR", TypeName = "VARCHAR(20)")]
        public string StopDoctor { get; set; }

        /// <summary>
        /// 开医嘱校对护士
        /// </summary>
        [Column("NURSE", TypeName = "VARCHAR(20)")]
        public string Nurse { get; set; }

        /// <summary>
        /// 停医嘱校对护士
        /// </summary>
        [Column("STOP_NURSE", TypeName = "VARCHAR(20)")]
        public string StopNurse { get; set; }

        /// <summary>
        /// 1 新开,2 校对,3 停止,4 作废
        /// </summary>
        [Column("ORDER_STATUS", TypeName = "VARCHAR(1)")]
        public string OrderStatus { get; set; }

        /// <summary>
        /// 医生代码
        /// </summary>
        [Column("DOCTOR_USER", TypeName = "VARCHAR(16)")]
        public string DoctorUser { get; set; }

        /// <summary>
        /// 校对时间
        /// </summary>
        [Column("VERIFY_DATA_TIME", TypeName = "DATETIME")]
        public DateTime? VerifyDataTime { get; set; }

        /// <summary>
        /// 药品规格
        /// </summary>
        [Column("DRUG_SPEC", TypeName = "VARCHAR(20)")]
        public string DrugSpec { get; set; }

        /// <summary>
        /// 药品供货商
        /// </summary>
        [Column("FIRM_ID", TypeName = "VARCHAR(30)")]
        public string FirmId { get; set; }
    }
}
